﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Maestro.master" AutoEventWireup="true" CodeFile="AsignarRepuestos.aspx.cs" Inherits="AsignarRepuestos" %>

<%@ Register assembly="DevExpress.Web.ASPxGridView.v9.2, Version=9.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxGridView" tagprefix="dxwgv" %>
<%@ Register assembly="DevExpress.Web.ASPxEditors.v9.2, Version=9.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxEditors" tagprefix="dxe" %>

<%@ Register assembly="DevExpress.Web.v9.2, Version=9.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxPopupControl" tagprefix="dxpc" %>

<%@ Register assembly="DevExpress.Web.v9.2, Version=9.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxDataView" tagprefix="dxdv" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    <style type="text/css">
        .style2
        {
            height: 18px;
            text-align: left;
        }
        .style3
        {
            font-weight: bold;
        }
        .style4
        {
            height: 18px;
            text-align: right;
        }
        .style5
        {
            height: 42px;
            text-align: right;
            color: #000000;
        }
        .style6
        {
            height: 42px;
            text-align: left;
        }
        .style7
        {
            text-align: left;
        }
        .style8
        {
            text-align: right;
        }
        .style9
        {
            text-align: left;
            font-weight: bold;
        }
        .style10
        {
            height: 18px;
            text-align: left;
            font-weight: bold;
        }
        </style>
    
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <div align="center">
        <asp:FormView ID="FormView1" runat="server" DataSourceID="dsPresupuesto" 
            EnableModelValidation="True">
            <ItemTemplate>
                <table bgcolor="White" 
                    style="padding: 2px; margin: auto; border: thin solid #A3C0E8; float: right" 
                    width="500">
                    <tr>
                        <td class="style8">
                            Apellido</td>
                        <td>
                            <dxe:ASPxLabel ID="lblApellido" runat="server" style="font-weight: 700" 
                                Text='<%# Eval("Apellido") %>'>
                            </dxe:ASPxLabel>
                        </td>
                        <td>
                            &nbsp;&nbsp;&nbsp; &nbsp;</td>
                        <td class="style8">
                            Nombre</td>
                        <td>
                            <dxe:ASPxLabel ID="lblNombre" runat="server" style="font-weight: 700" 
                                Text='<%# Eval("Nombre") %>'>
                            </dxe:ASPxLabel>
                        </td>
                        <td>
                            &nbsp;&nbsp;&nbsp; &nbsp;</td>
                        <td class="style8">
                            Teléfono</td>
                        <td>
                            <dxe:ASPxLabel ID="lblTelefono" runat="server" style="font-weight: 700" 
                                Text='<%# Eval("CelularTelefono") %>'>
                            </dxe:ASPxLabel>
                        </td>
                    </tr>
                    <tr>
                        <td class="style8">
                            Patente</td>
                        <td>
                            <dxe:ASPxLabel ID="lblPatente" runat="server" style="font-weight: 700" 
                                Text='<%# Eval("Patente") %>'>
                            </dxe:ASPxLabel>
                        </td>
                        <td>
                            &nbsp;</td>
                        <td class="style8">
                            Marca</td>
                        <td>
                            <dxe:ASPxLabel ID="lblMarca" runat="server" style="font-weight: 700" 
                                Text='<%# Eval("Marca") %>'>
                            </dxe:ASPxLabel>
                        </td>
                        <td>
                            &nbsp;</td>
                        <td class="style8">
                            Modelo</td>
                        <td>
                            <dxe:ASPxLabel ID="lblModelo" runat="server" style="font-weight: 700" 
                                Text='<%# Eval("Modelo") %>'>
                            </dxe:ASPxLabel>
                        </td>
                    </tr>
                </table>
            </ItemTemplate>
        </asp:FormView>
        <asp:ObjectDataSource ID="dsPresupuesto" runat="server" 
            OldValuesParameterFormatString="original_{0}" SelectMethod="CrearPresupuesto" 
            TypeName="SGT_ON.ONPresupuesto">
            <SelectParameters>
                <asp:QueryStringParameter DefaultValue="-1" Name="pID" QueryStringField="IDPre" 
                    Type="Int32" />
            </SelectParameters>
        </asp:ObjectDataSource>
   </div>
   <div>
      
   </div>
   <div align="center">

       <dxwgv:ASPxGridView ID="gvProductosEnPresupuesto" runat="server" 
           AutoGenerateColumns="False" CssFilePath="~/App_Themes/Aqua/{0}/styles.css" 
           CssPostfix="Aqua" DataSourceID="dsProductosEnPresupuesto" 
           KeyFieldName="ID" 
           oncustombuttoncallback="gvProductosEnPresupuesto_CustomButtonCallback">
           <ClientSideEvents CustomButtonClick="function(s, e) {
	if (confirm ('Va a eliminar la asocicación, ¿está seguro?'))
	{
		e.processOnServer = true;
	}
	else
	{
		e.processOnServer = false;
	}
}" />
           <Columns>
<dxwgv:GridViewDataTextColumn FieldName="ElementoNombre" ShowInCustomizationForm="True" 
                   Caption="Item" VisibleIndex="0" ReadOnly="True"></dxwgv:GridViewDataTextColumn>
               <dxwgv:GridViewDataTextColumn FieldName="ProductoNombre" VisibleIndex="1" 
                   Caption="Producto">
               </dxwgv:GridViewDataTextColumn>
               <dxwgv:GridViewDataTextColumn VisibleIndex="2" Caption="En depósito" 
                   ShowInCustomizationForm="True">
                   <DataItemTemplate>
                       <asp:ImageButton ID="btnEstablecerProductoEstaEnDeposito" runat="server" 
                           CommandArgument='<%# Eval("ID") %>' ImageUrl="~/Imagenes/arrow_up.png" 
                           onclick="btnEstablecerProductoEstaEnDeposito_Click" 
                           onclientclick="return confirm(&quot;Va a establecer que el producto está en depósito, ¿esta seguro?&quot;)" 
                           ToolTip="Haga clic aquí para establecer que el producto SI está en depósito" 
                           Visible='<%# !(bool)Eval("ProductoEnDeposito") %>' />
                       <asp:ImageButton ID="btnEstablecerProductoHaSidoEntregado" runat="server" 
                           CommandArgument='<%# Eval("ID") %>' ImageUrl="~/Imagenes/arrow_down.png" 
                           onclick="btnEstablecerProductoHaSidoEntregado_Click" 
                           onclientclick="return confirm(&quot;Va a establecer que el producto ha sido entregado, ¿esta seguro?&quot;)" 
                           ToolTip="Haga clic aquí para establecer que el producto ha sido entregado y NO está en depósito" 
                           Visible='<%# Eval("ProductoEnDeposito") %>' />
                       <asp:Label ID="lblProductoEnDeposito" runat="server" 
                           Text='<%# Eval("ProductoEnDepositoString") %>'></asp:Label>
                   </DataItemTemplate>
               </dxwgv:GridViewDataTextColumn>
               <dxwgv:GridViewDataTextColumn FieldName="PrecioUnitarioString" VisibleIndex="3" 
                   Caption="P. Unitairo" ReadOnly="True">
               </dxwgv:GridViewDataTextColumn>
               <dxwgv:GridViewDataTextColumn FieldName="Cantidad" VisibleIndex="4">
               </dxwgv:GridViewDataTextColumn>
               <dxwgv:GridViewDataTextColumn 
                   FieldName="PrecioVentaString" VisibleIndex="5" Caption="P. Venta" 
                   ReadOnly="True">
               </dxwgv:GridViewDataTextColumn>
               <dxwgv:GridViewDataTextColumn Caption="Asignado por" 
                   FieldName="Responsable" VisibleIndex="6">
               </dxwgv:GridViewDataTextColumn>
               <dxwgv:GridViewDataTextColumn Caption="Ubicación" FieldName="ProductoUbicacion" 
                   VisibleIndex="7">
               </dxwgv:GridViewDataTextColumn>
               <dxwgv:GridViewCommandColumn ButtonType="Image" Caption=" " 
                   ShowInCustomizationForm="True" VisibleIndex="8">
                   <ClearFilterButton Visible="True">
                   </ClearFilterButton>
                   <CustomButtons>
                       <dxwgv:GridViewCommandColumnCustomButton ID="Liberar" Text="Liberar producto">
                           <Image Url="~/Imagenes/delete.png" AlternateText="fasfhsdhlflafjhaslk" />
                       </dxwgv:GridViewCommandColumnCustomButton>
                   </CustomButtons>
               </dxwgv:GridViewCommandColumn>
           </Columns>
           <SettingsPager Mode="ShowAllRecords">
               <AllButton>
                   <Image Height="19px" Width="27px" />
               </AllButton>
               <FirstPageButton>
                   <Image Height="19px" Width="23px" />
               </FirstPageButton>
               <LastPageButton>
                   <Image Height="19px" Width="23px" />
               </LastPageButton>
               <NextPageButton>
                   <Image Height="19px" Width="19px" />
               </NextPageButton>
               <PrevPageButton>
                   <Image Height="19px" Width="19px" />
               </PrevPageButton>
           </SettingsPager>
           <Settings ShowTitlePanel="True" />
           <SettingsText EmptyDataRow="No se han asignado repuestos" 
               Title="Repuestos asignados" />
           <SettingsLoadingPanel Text="" />
           <Images ImageFolder="~/App_Themes/Aqua/{0}/">
               <CollapsedButton Height="15px" 
                   Url="~/App_Themes/Aqua/GridView/gvCollapsedButton.png" Width="15px" />
               <ExpandedButton Height="15px" 
                   Url="~/App_Themes/Aqua/GridView/gvExpandedButton.png" Width="15px" />
               <DetailCollapsedButton Height="15px" 
                   Url="~/App_Themes/Aqua/GridView/gvDetailCollapsedButton.png" Width="15px" />
               <DetailExpandedButton Height="15px" 
                   Url="~/App_Themes/Aqua/GridView/gvDetailExpandedButton.png" Width="15px" />
               <HeaderFilter Height="19px" Url="~/App_Themes/Aqua/GridView/gvHeaderFilter.png" 
                   Width="19px" />
               <HeaderActiveFilter Height="19px" 
                   Url="~/App_Themes/Aqua/GridView/gvHeaderFilterActive.png" Width="19px" />
               <HeaderSortDown Height="5px" 
                   Url="~/App_Themes/Aqua/GridView/gvHeaderSortDown.png" Width="7px" />
               <HeaderSortUp Height="5px" Url="~/App_Themes/Aqua/GridView/gvHeaderSortUp.png" 
                   Width="7px" />
               <FilterRowButton Height="13px" Width="13px" />
               <WindowResizer Height="13px" Url="~/App_Themes/Aqua/GridView/WindowResizer.png" 
                   Width="13px" />
           </Images>
           <ImagesEditors>
               <CalendarFastNavPrevYear Height="19px" 
                   Url="~/App_Themes/Aqua/Editors/edtCalendarFNPrevYear.png" Width="19px" />
               <CalendarFastNavNextYear Height="19px" 
                   Url="~/App_Themes/Aqua/Editors/edtCalendarFNNextYear.png" Width="19px" />
               <DropDownEditDropDown Height="7px" 
                   Url="~/App_Themes/Aqua/Editors/edtDropDown.png" 
                   UrlDisabled="~/App_Themes/Aqua/Editors/edtDropDownDisabled.png" 
                   UrlHottracked="~/App_Themes/Aqua/Editors/edtDropDownHottracked.png" 
                   Width="9px" />
               <SpinEditIncrement Height="7px" 
                   Url="~/App_Themes/Aqua/Editors/edtSpinEditIncrementImage.png" 
                   UrlDisabled="~/App_Themes/Aqua/Editors/edtSpinEditIncrementDisabledImage.png" 
                   UrlHottracked="~/App_Themes/Aqua/Editors/edtSpinEditIncrementHottrackedImage.png" 
                   UrlPressed="~/App_Themes/Aqua/Editors/edtSpinEditIncrementHottrackedImage.png" 
                   Width="7px" />
               <SpinEditDecrement Height="7px" 
                   Url="~/App_Themes/Aqua/Editors/edtSpinEditDecrementImage.png" 
                   UrlDisabled="~/App_Themes/Aqua/Editors/edtSpinEditDecrementDisabledImage.png" 
                   UrlHottracked="~/App_Themes/Aqua/Editors/edtSpinEditDecrementHottrackedImage.png" 
                   UrlPressed="~/App_Themes/Aqua/Editors/edtSpinEditDecrementHottrackedImage.png" 
                   Width="7px" />
               <SpinEditLargeIncrement Height="9px" 
                   Url="~/App_Themes/Aqua/Editors/edtSpinEditLargeIncImage.png" 
                   UrlDisabled="~/App_Themes/Aqua/Editors/edtSpinEditLargeIncDisabledImage.png" 
                   UrlHottracked="~/App_Themes/Aqua/Editors/edtSpinEditLargeIncHottrackedImage.png" 
                   UrlPressed="~/App_Themes/Aqua/Editors/edtSpinEditLargeIncHottrackedImage.png" 
                   Width="7px" />
               <SpinEditLargeDecrement Height="9px" 
                   Url="~/App_Themes/Aqua/Editors/edtSpinEditLargeDecImage.png" 
                   UrlDisabled="~/App_Themes/Aqua/Editors/edtSpinEditLargeDecDisabledImage.png" 
                   UrlHottracked="~/App_Themes/Aqua/Editors/edtSpinEditLargeDecHottrackedImage.png" 
                   UrlPressed="~/App_Themes/Aqua/Editors/edtSpinEditLargeDecHottrackedImage.png" 
                   Width="7px" />
           </ImagesEditors>
           <Styles CssFilePath="~/App_Themes/Aqua/{0}/styles.css" CssPostfix="Aqua">
           </Styles>
           <StylesEditors>
               <ProgressBar Height="25px">
               </ProgressBar>
           </StylesEditors>
       </dxwgv:ASPxGridView>
       <asp:ObjectDataSource ID="dsProductosEnPresupuesto" runat="server" 
           OldValuesParameterFormatString="original_{0}" 
           SelectMethod="ObtenerProductosDePresupuesto" 
           TypeName="SGT_ON.StockProductoEnPresupuesto">
           <SelectParameters>
               <asp:QueryStringParameter DefaultValue="-1" Name="pIdPresupuesto" 
                   QueryStringField="IDPre" Type="Int32" />
           </SelectParameters>
       </asp:ObjectDataSource>
       <br />
                                                
                                        <br />
       </div>
    <dxpc:aspxpopupcontrol ID="popBusqueda" runat="server" 
            AutoUpdatePosition="True" 
            CssFilePath="~/App_Themes/Office2003Olive/{0}/styles.css" 
            CssPostfix="Office2003_Olive" EnableHotTrack="False" 
            HeaderText="Productos" 
            ImageFolder="~/App_Themes/Office2003Olive/{0}/" Modal="True" 
            PopupHorizontalAlign="WindowCenter" PopupVerticalAlign="WindowCenter">
        <CloseButtonImage Height="12px" Width="13px" />
        <SizeGripImage Height="16px" Width="16px" />
<CloseButtonImage Height="12px" Width="13px"></CloseButtonImage>

<SizeGripImage Height="16px" Width="16px"></SizeGripImage>

        <HeaderStyle>
        <Paddings PaddingRight="6px" />
<Paddings PaddingRight="6px"></Paddings>
        </HeaderStyle>
        <ContentCollection>
            <dxpc:PopupControlContentControl ID="PopupControlContentControl1" runat="server" SupportsDisabledAttribute="True">
                <table align="center">
                    <tr>
                        <td align="center">
                            <dxwgv:ASPxGridView ID="gvProductos" runat="server" 
        AutoGenerateColumns="False" 
        CssFilePath="~/App_Themes/Office2003Olive/{0}/styles.css" 
        CssPostfix="Office2003_Olive" DataSourceID="dsProductos" 
        KeyFieldName="ID" style="text-align: left" Width="100%">
                                <Columns>
                                    <dxwgv:GridViewDataTextColumn Caption="Nombre" 
                ShowInCustomizationForm="True" VisibleIndex="0">
                                        <DataItemTemplate>
                                            <asp:HyperLink ID="lnkProductoASeleccionar" runat="server" 
                                                NavigateUrl='<%# "~/AsignarRepuestos.aspx?IDPro="+Eval("ID") %>' 
                                                Text='<%# Eval("Nombre") %>' 
                                                ondatabinding="lnkProductoASeleccionar_DataBinding"></asp:HyperLink>
                                        </DataItemTemplate>
                                        <CellStyle Wrap="False">
                                        </CellStyle>
                                    </dxwgv:GridViewDataTextColumn>
                                    <dxwgv:GridViewDataTextColumn FieldName="Cantidad" 
                                        ShowInCustomizationForm="True" VisibleIndex="1" Caption="Stock">
                                    </dxwgv:GridViewDataTextColumn>
                                    <dxwgv:GridViewDataTextColumn FieldName="Marca" ShowInCustomizationForm="True" 
                                        VisibleIndex="2">
                                        <CellStyle Wrap="False">
                                        </CellStyle>
                                    </dxwgv:GridViewDataTextColumn>
                                    <dxwgv:GridViewDataTextColumn FieldName="Ubicacion" ShowInCustomizationForm="True" 
                                        VisibleIndex="3">
                                    </dxwgv:GridViewDataTextColumn>
                                </Columns>
                                <SettingsBehavior AllowFocusedRow="True" EnableRowHotTrack="True" />

<SettingsBehavior AllowFocusedRow="True" EnableRowHotTrack="True"></SettingsBehavior>

                                <SettingsPager PageSize="20">
                                </SettingsPager>
                                <Images ImageFolder="~/App_Themes/Office2003Olive/{0}/">
                                    <CollapsedButton Height="12px" 
                Url="~/App_Themes/Office2003Olive/GridView/gvCollapsedButton.png" 
                Width="11px" />
                                    <ExpandedButton Height="12px" 
                Url="~/App_Themes/Office2003Olive/GridView/gvExpandedButton.png" Width="11px" />
                                    <DetailCollapsedButton Height="12px" 
                Url="~/App_Themes/Office2003Olive/GridView/gvCollapsedButton.png" 
                Width="11px" />
                                    <DetailExpandedButton Height="12px" 
                Url="~/App_Themes/Office2003Olive/GridView/gvExpandedButton.png" Width="11px" />
                                    <FilterRowButton Height="13px" Width="13px" />
<CollapsedButton Height="12px" Width="11px" Url="~/App_Themes/Office2003Olive/GridView/gvCollapsedButton.png"></CollapsedButton>

<ExpandedButton Height="12px" Width="11px" Url="~/App_Themes/Office2003Olive/GridView/gvExpandedButton.png"></ExpandedButton>

<DetailCollapsedButton Height="12px" Width="11px" Url="~/App_Themes/Office2003Olive/GridView/gvCollapsedButton.png"></DetailCollapsedButton>

<DetailExpandedButton Height="12px" Width="11px" Url="~/App_Themes/Office2003Olive/GridView/gvExpandedButton.png"></DetailExpandedButton>

<FilterRowButton Height="13px" Width="13px"></FilterRowButton>
                                </Images>
                                <Styles CssFilePath="~/App_Themes/Office2003Olive/{0}/styles.css" 
            CssPostfix="Office2003_Olive">
                                    <Header ImageSpacing="5px" SortingImageSpacing="5px">
                                    </Header>
                                    <LoadingPanel ImageSpacing="10px">
                                    </LoadingPanel>
                                </Styles>
                                <StylesEditors>
                                    <ProgressBar Height="25px">
                                    </ProgressBar>
                                </StylesEditors>
                                <Templates>
                                    <EmptyDataRow>
                                        <br />
                                        <span class="dxncEmptyData_Soft_Orange">No se encontraron registros</span><br /></EmptyDataRow>
                                </Templates>
                            </dxwgv:ASPxGridView>
                        </td>
                    </tr>
                </table>
                <asp:ObjectDataSource ID="dsProductos" runat="server" 
        SelectMethod="ObtenerPorTextoParaAgregarAPresupuesto" 
        TypeName="SGT_ON.StockProducto" 
        OldValuesParameterFormatString="original_{0}">
                    <SelectParameters>
                        <asp:ControlParameter ControlID="txtTexto" Name="pTexto" PropertyName="Text" 
                Type="String" />
                    </SelectParameters>
                </asp:ObjectDataSource>
            </dxpc:PopupControlContentControl>
        </ContentCollection>
    </dxpc:aspxpopupcontrol>
    <table align="center" bgcolor="White">
        <tr>
            <td style="padding: 2px; margin: auto; border: thin solid #A3C0E8; float: right" 
                valign="top" height="100%" width="400">
            
                    
                <table align="center">
                    <tr>
                        <td>
                                <asp:TextBox ID="txtTexto" runat="server" MaxLength="12" Width="150px" ToolTip="Se busca por Apellido, Nombre, Marca, Modelo, Aseguradora, Patente, Proveedor de repuestos, Inspector y Numero de chasis."
                                    OnTextChanged="txtTexto_TextChanged" AutoPostBack="True"></asp:TextBox>
                                </aspxtextbox>
                            </td>
                        <td style="margin-left: 40px">
                            <asp:ImageButton ID="btnBuscar" runat="server" Height="22px" 
                                    ImageUrl="~/Imagenes/lupa.gif" onclick="btnBuscar_Click1" ToolTip="Buscar" 
                                    CausesValidation="False" />
                        </td>
                    </tr>
                </table>
                
                <asp:FormView ID="fvProducto" runat="server" DataSourceID="dsProducto" 
                    EnableModelValidation="True">
                    <ItemTemplate>
                        <table>
                            <tr>
                                <td class="style8" nowrap="nowrap">
                                    Nombre</td>
                                <td nowrap="nowrap" class="style9" width="100%">
                                    <asp:Label ID="NombreLabel" runat="server" Text='<%# Eval("Nombre") %>' />
                                </td>
                                <td nowrap="nowrap" rowspan="14">
                                    &nbsp;</td>
                            </tr>
                            <tr>
                                <td class="style8" nowrap="nowrap">
                                    Marca</td>
                                <td nowrap="nowrap" class="style9" width="100%">
                                    <asp:Label ID="MarcaLabel" runat="server" Text='<%# Eval("Marca") %>' />
                                </td>
                            </tr>
                            <tr>
                                <td class="style8" nowrap="nowrap">
                                    Stock actual</td>
                                <td nowrap="nowrap" class="style7" width="100%">
                                    <b>
                                    <asp:Label ID="CantidadLabel" runat="server" Text='<%# Eval("Cantidad") %>' />
                                    </b>&nbsp;<b><asp:Label ID="UnidadDeMedidaLabel" runat="server" 
                                        Text='<%# Eval("UnidadDeMedida") %>' />
                                    </b>
                                </td>
                            </tr>
                            <tr>
                                <td class="style5" nowrap="nowrap">
                                    <b>Cantidad a asignar</b></td>
                                <td class="style6" nowrap="nowrap" width="100%">
                                    <asp:TextBox ID="txtCantidadAAsignar" runat="server" Width="30px" 
                                        CssClass="style3">1</asp:TextBox>
                                    <b>
                                    <asp:Label ID="UnidadDeMedidaLabel0" runat="server" 
                                        Text='<%# Eval("UnidadDeMedida") %>' />
                                    <br />
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                                        ControlToValidate="txtCantidadAAsignar" Display="Dynamic" 
                                        ErrorMessage="Debe ingresar un valor"></asp:RequiredFieldValidator>
                                    <asp:RangeValidator ID="RangeValidator1" runat="server" 
                                        ControlToValidate="txtCantidadAAsignar" Display="Dynamic" 
                                        ErrorMessage="Debe ingresar un numero entero mayor a 0 &lt;br /&gt;" 
                                        MaximumValue="9999999" MinimumValue="1" Type="Integer"></asp:RangeValidator>
                                    <asp:CustomValidator ID="CustomValidator1" runat="server" 
                                        ControlToValidate="txtCantidadAAsignar" Display="Dynamic" 
                                        ErrorMessage="El valor ingresado es mayor que el stock actual" 
                                        onservervalidate="CustomValidator1_ServerValidate"></asp:CustomValidator>
                                    </b>
                                </td>
                            </tr>
                            <tr>
                                <td class="style4" nowrap="nowrap">
                                    <b>Producto en depósito</b></td>
                                <td class="style2" nowrap="nowrap" width="100%">
                                    <dxe:ASPxCheckBox ID="chkProductoEstaEnDeposito" runat="server" Checked="true" 
                                        ToolTip="Destildar si se entrega">
                                    </dxe:ASPxCheckBox>
                                </td>
                            </tr>
                            <tr>
                                <td class="style4" nowrap="nowrap">
                                    Precio costo</td>
                                <td class="style10" nowrap="nowrap" width="100%">
                                    <asp:Label ID="PrecioCostoStringLabel" runat="server" 
                                        Text='<%# Eval("PrecioCostoString") %>' />
                                </td>
                            </tr>
                            <tr>
                                <td class="style8" nowrap="nowrap">
                                    Precio venta</td>
                                <td nowrap="nowrap" class="style9" width="100%">
                                    <asp:Label ID="PrecioVentaStringLabel" runat="server" 
                                        Text='<%# Eval("PrecioVentaString") %>' />
                                </td>
                            </tr>
                            <tr>
                                <td class="style8" nowrap="nowrap">
                                    IVA</td>
                                <td nowrap="nowrap" class="style9" width="100%">
                                    <asp:Label ID="IVAStringLabel" runat="server" Text='<%# Eval("IVAString") %>' />
                                </td>
                            </tr>
                            <tr>
                                <td class="style8" nowrap="nowrap">
                                    Monto IVA</td>
                                <td nowrap="nowrap" class="style9" width="100%">
                                    &nbsp;</td>
                            </tr>
                            <tr>
                                <td class="style8" nowrap="nowrap">
                                    Subtotal</td>
                                <td nowrap="nowrap" class="style9" width="100%">
                                    &nbsp;</td>
                            </tr>
                            <tr>
                                <td class="style8" nowrap="nowrap">
                                    Codigo original</td>
                                <td nowrap="nowrap" class="style9" width="100%">
                                    <asp:Label ID="CodigoOriginalLabel" runat="server" 
                                        Text='<%# Eval("CodigoOriginal") %>' />
                                </td>
                            </tr>
                            <tr>
                                <td class="style8" nowrap="nowrap">
                                    Codigo taller</td>
                                <td nowrap="nowrap" class="style9" width="100%">
                                    <asp:Label ID="CodigoTallerLabel" runat="server" 
                                        Text='<%# Eval("CodigoTaller") %>' />
                                </td>
                            </tr>
                            <tr>
                                <td class="style8" nowrap="nowrap">
                                    Es nuevo</td>
                                <td nowrap="nowrap" class="style7" width="100%">
                                    <dxe:ASPxCheckBox ID="chkEsNuevo" runat="server" ReadOnly="True" 
                                        Value='<%# Eval("EsNuevo") %>'>
                                    </dxe:ASPxCheckBox>
                                </td>
                            </tr>
                            <tr>
                                <td class="style8" nowrap="nowrap">
                                    Ubicacion</td>
                                <td nowrap="nowrap" class="style9" width="100%">
                                    <asp:Label ID="UbicacionLabel" runat="server" Text='<%# Eval("Ubicacion") %>' />
                                </td>
                            </tr>
                            <tr>
                                <td class="style8" nowrap="nowrap">
                                    Descripcion</td>
                                <td nowrap="nowrap" class="style9" width="100%">
                                    <dxe:ASPxLabel ID="lblDescripcion" runat="server" 
                                        Text='<%# Eval("Descripcion") %>'>
                                    </dxe:ASPxLabel>
                                </td>
                            </tr>
                            <tr>
                                <td class="style3" nowrap="nowrap">
                                    &nbsp;</td>
                                <td nowrap="nowrap" class="style7" width="100%">
                                    &nbsp;</td>
                                <td nowrap="nowrap">
                                    &nbsp;</td>
                            </tr>
                            <tr>
                                <td nowrap="nowrap">
                                    </td>
                                <td nowrap="nowrap" width="100%">
                                    <dxe:ASPxButton ID="btnAsignar" runat="server" 
                                        CssFilePath="~/App_Themes/Aqua/{0}/styles.css" CssPostfix="Aqua" 
                                        onclick="btnAsignar_Click" Text="Asignar">
                                    </dxe:ASPxButton>
                                </td>
                                <td nowrap="nowrap">
                                    </td>
                            </tr>
                            <tr>
                                <td class="style3" colspan="2" nowrap="nowrap">
                                    <asp:CustomValidator ID="cvRepuestoSinAsignar" runat="server" 
                                        ControlToValidate="txtCantidadAAsignar" Display="Dynamic" 
                                        ErrorMessage="Debe seleccionar un repuesto sin asignar" 
                                        onservervalidate="cvRepuestoSinAsignar_ServerValidate"></asp:CustomValidator>
                                    <asp:CustomValidator ID="cvRepuestoSinAsignarMasDeUno" runat="server" 
                                        ControlToValidate="txtCantidadAAsignar" Display="Dynamic" 
                                        ErrorMessage="Debe seleccionar solo un repuesto sin asignar" 
                                        onservervalidate="cvRepuestoSinAsignarMasDeUno_ServerValidate"></asp:CustomValidator>
                                </td>
                                <td nowrap="nowrap">
                                </td>
                            </tr>
                            <tr>
                                <td class="style3" colspan="2" nowrap="nowrap" width="100%">
                                    <dxe:ASPxImage ID="imgFoto" runat="server" ImageAlign="Middle" 
                                        ImageUrl='<%# Eval("FotoURL") %>' IsPng="True" Width="400px">
                                        <EmptyImage Url="~/Fotos/Productos/Imagen_No_Disponible.png" />
                                    </dxe:ASPxImage>
                                </td>
                                <td nowrap="nowrap">
                                    &nbsp;</td>
                            </tr>
                        </table>
                    </ItemTemplate>
                </asp:FormView>
                <asp:ObjectDataSource ID="dsProducto" runat="server" 
                    OldValuesParameterFormatString="original_{0}" SelectMethod="CrearStockProducto" 
                    TypeName="SGT_ON.StockProducto" onselecting="dsProducto_Selecting">
                    <SelectParameters>
                        <asp:QueryStringParameter DefaultValue="-1" Name="pID" QueryStringField="IDPro" 
                            Type="Int32" />
                    </SelectParameters>
                </asp:ObjectDataSource>
            </td>
            
            <td align="center" valign="top">
        
                &nbsp;&nbsp;&nbsp; &nbsp;</td>
            <td align="center" valign="top" 
                style="padding: 2px; margin: auto; border: thin solid #A3C0E8;" width="400">
        &nbsp;<dxwgv:ASPxGridView ID="gvElementosSinAsignar" runat="server" 
            AutoGenerateColumns="False" CssFilePath="~/App_Themes/Aqua/{0}/styles.css" 
            CssPostfix="Aqua" DataSourceID="dsElementosSinAsignar" KeyFieldName="ID" 
                    ClientInstanceName="grid">
                <ClientSideEvents FocusedRowChanged="function(s, e) {
	UpdateFocusedTotalText();
}" />
            <Columns>
                <dxwgv:GridViewCommandColumn ShowInCustomizationForm="True" 
                    ShowSelectCheckbox="True" VisibleIndex="0">
                </dxwgv:GridViewCommandColumn>
                <dxwgv:GridViewDataTextColumn FieldName="Item" ShowInCustomizationForm="True" 
                    VisibleIndex="1">
                    <CellStyle Wrap="False">
                    </CellStyle>
                </dxwgv:GridViewDataTextColumn>
                <dxwgv:GridViewDataTextColumn FieldName="ReponerCantidadString" 
                    ShowInCustomizationForm="True" VisibleIndex="2" Caption="Precio cliente">
                </dxwgv:GridViewDataTextColumn>
                <dxwgv:GridViewDataTextColumn FieldName="ReponerCantidad" Visible="False" 
                    VisibleIndex="5">
                </dxwgv:GridViewDataTextColumn>
            </Columns>
                <SettingsBehavior AllowFocusedRow="True" />
            <SettingsPager Mode="ShowAllRecords">
                <AllButton>
                    <Image Height="19px" Width="27px" />
                </AllButton>
                <FirstPageButton>
                    <Image Height="19px" Width="23px" />
                </FirstPageButton>
                <LastPageButton>
                    <Image Height="19px" Width="23px" />
                </LastPageButton>
                <NextPageButton>
                    <Image Height="19px" Width="19px" />
                </NextPageButton>
                <PrevPageButton>
                    <Image Height="19px" Width="19px" />
                </PrevPageButton>
            </SettingsPager>
            <Settings ShowTitlePanel="True" GroupFormat="{1} {2}" />
            <SettingsText Title="Repuestos sin asignar" 
                    EmptyDataRow="No hay repuestos sin asignar" />
            <SettingsLoadingPanel Text="" />
            <Images ImageFolder="~/App_Themes/Aqua/{0}/">
                <CollapsedButton Height="15px" 
                    Url="~/App_Themes/Aqua/GridView/gvCollapsedButton.png" Width="15px" />
                <ExpandedButton Height="15px" 
                    Url="~/App_Themes/Aqua/GridView/gvExpandedButton.png" Width="15px" />
                <DetailCollapsedButton Height="15px" 
                    Url="~/App_Themes/Aqua/GridView/gvDetailCollapsedButton.png" Width="15px" />
                <DetailExpandedButton Height="15px" 
                    Url="~/App_Themes/Aqua/GridView/gvDetailExpandedButton.png" Width="15px" />
                <HeaderFilter Height="19px" Url="~/App_Themes/Aqua/GridView/gvHeaderFilter.png" 
                    Width="19px" />
                <HeaderActiveFilter Height="19px" 
                    Url="~/App_Themes/Aqua/GridView/gvHeaderFilterActive.png" Width="19px" />
                <HeaderSortDown Height="5px" 
                    Url="~/App_Themes/Aqua/GridView/gvHeaderSortDown.png" Width="7px" />
                <HeaderSortUp Height="5px" Url="~/App_Themes/Aqua/GridView/gvHeaderSortUp.png" 
                    Width="7px" />
                <FilterRowButton Height="13px" Width="13px" />
                <WindowResizer Height="13px" Url="~/App_Themes/Aqua/GridView/WindowResizer.png" 
                    Width="13px" />
            </Images>
            <ImagesEditors>
                <CalendarFastNavPrevYear Height="19px" 
                    Url="~/App_Themes/Aqua/Editors/edtCalendarFNPrevYear.png" Width="19px" />
                <CalendarFastNavNextYear Height="19px" 
                    Url="~/App_Themes/Aqua/Editors/edtCalendarFNNextYear.png" Width="19px" />
                <DropDownEditDropDown Height="7px" 
                    Url="~/App_Themes/Aqua/Editors/edtDropDown.png" 
                    UrlDisabled="~/App_Themes/Aqua/Editors/edtDropDownDisabled.png" 
                    UrlHottracked="~/App_Themes/Aqua/Editors/edtDropDownHottracked.png" 
                    Width="9px" />
                <SpinEditIncrement Height="7px" 
                    Url="~/App_Themes/Aqua/Editors/edtSpinEditIncrementImage.png" 
                    UrlDisabled="~/App_Themes/Aqua/Editors/edtSpinEditIncrementDisabledImage.png" 
                    UrlHottracked="~/App_Themes/Aqua/Editors/edtSpinEditIncrementHottrackedImage.png" 
                    UrlPressed="~/App_Themes/Aqua/Editors/edtSpinEditIncrementHottrackedImage.png" 
                    Width="7px" />
                <SpinEditDecrement Height="7px" 
                    Url="~/App_Themes/Aqua/Editors/edtSpinEditDecrementImage.png" 
                    UrlDisabled="~/App_Themes/Aqua/Editors/edtSpinEditDecrementDisabledImage.png" 
                    UrlHottracked="~/App_Themes/Aqua/Editors/edtSpinEditDecrementHottrackedImage.png" 
                    UrlPressed="~/App_Themes/Aqua/Editors/edtSpinEditDecrementHottrackedImage.png" 
                    Width="7px" />
                <SpinEditLargeIncrement Height="9px" 
                    Url="~/App_Themes/Aqua/Editors/edtSpinEditLargeIncImage.png" 
                    UrlDisabled="~/App_Themes/Aqua/Editors/edtSpinEditLargeIncDisabledImage.png" 
                    UrlHottracked="~/App_Themes/Aqua/Editors/edtSpinEditLargeIncHottrackedImage.png" 
                    UrlPressed="~/App_Themes/Aqua/Editors/edtSpinEditLargeIncHottrackedImage.png" 
                    Width="7px" />
                <SpinEditLargeDecrement Height="9px" 
                    Url="~/App_Themes/Aqua/Editors/edtSpinEditLargeDecImage.png" 
                    UrlDisabled="~/App_Themes/Aqua/Editors/edtSpinEditLargeDecDisabledImage.png" 
                    UrlHottracked="~/App_Themes/Aqua/Editors/edtSpinEditLargeDecHottrackedImage.png" 
                    UrlPressed="~/App_Themes/Aqua/Editors/edtSpinEditLargeDecHottrackedImage.png" 
                    Width="7px" />
            </ImagesEditors>
            <Styles CssFilePath="~/App_Themes/Aqua/{0}/styles.css" CssPostfix="Aqua">
            </Styles>
            <StylesEditors>
                <ProgressBar Height="25px">
                </ProgressBar>
            </StylesEditors>
        </dxwgv:ASPxGridView>
            <asp:ObjectDataSource ID="dsElementosSinAsignar" runat="server" 
                OldValuesParameterFormatString="original_{0}" 
                SelectMethod="ObtenerRepuestosDePresupuestoNoAsignados" 
                TypeName="SGT_ON.ONElemento">
                <SelectParameters>
                    <asp:QueryStringParameter DefaultValue="-1" Name="pPresupuestoId" 
                        QueryStringField="IDPre" Type="Int32" />
                </SelectParameters>
            </asp:ObjectDataSource>
            </td>
    </td>
        </tr>
    </table>
</asp:Content>

